<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .triangle {
            width: 0;
            height: 0;
            border: 20px solid transparent;
            border-left: 20px solid purple;
        }

        .box {
            width: 50px;
            height: 40px;
            position: relative;
        }
        
        .con {
            border-radius: 5px;
            background-color: green;
            width: 40px;
            height: 35px;
            position: absolute;
            left: 5px;
        }

        .con::before{
            width: 0;
            position: absolute;
            height: 0;
            content: '';
            border: 6px solid transparent;
            border-right: 6px solid green;
            left: -12px;
            top: 11px;
        }
        </style>
</head>
<body>
    <!-- 三角形 -->
    <div class="triangle"></div>
    
    <!-- 实现对话框  -->
    <div class="box">
        <div class="con"></div>
    </div>
</body>
</html>